function setImgForIE(url){
    $("#cropbox,#preview").attr("src",url);
    $("#imgSrc").val(url);
    var childImage = $('#cropbox').load(function(e){
        var image = this;
    // var image  = new Image();
    // image.src = url;
    // image.onload = function () {
        // boundx = image.width ;
        // boundy = image.height;
        // debugger;
        scopePic = 1;
        $("#cropbox").css({
            // "width":boundx+'px',
            // "height":boundy+'px',
            "display":"none"
        })
        // IE 7-8
        $(".preview-container").append('<span>上传成功，点击“裁剪”按钮，进行裁剪</span>');
        $(".cutpic").show();
        $(".success").prop("disabled",true);
        $(".cutpic").click(function(e){
            e.preventDefault();
            e.stopPropagation();
            $(".preview-container span").remove();
            $(".success").prop("disabled",false);
            $("#cropbox").show();
            imageCrop();
        });
    });
}

// IE7 事件兼容
function addEvent(evnt, elem, func) {
   if (elem.addEventListener)  // W3C DOM
      elem.addEventListener(evnt,func,false);
   else if (elem.attachEvent) { // IE DOM
      elem.attachEvent("on"+evnt, func);
   }
   else { // No much to do
      elem[evnt] = func;
   }
}
// var elem = document.getElementById("fileupload");

// elem.onpropertychange = function(){
//     debugger;
//     if(this.value!=''){
//         $(".imgModel").show();
//     }
// }

// $(document).on("change","#fileupload",function(e){
//     debugger;
//     $(".imgModel").show();
// });

function handleFileSelect(){
    $(".imgModel").show();
}

var elem = document.getElementById("fileupload");

addEvent('change',elem,handleFileSelect);


